<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>以输出缓冲处理程序转换字符编码</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.iconv.html">iconv</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.intl.html">intl</a></div>
 <div class="up"><a href="ref.iconv.html">iconv 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.ob-iconv-handler" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ob_iconv_handler</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">ob_iconv_handler</span> &mdash; <span class="dc-title">以输出缓冲处理程序转换字符编码</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ob-iconv-handler-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>ob_iconv_handler</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$contents</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$status</code></span>
   )</div>

  <p class="para rdfs-comment">
   将字符编码从 <em><code class="parameter">internal_encoding</code></em> 转换到 <em><code class="parameter">output_encoding</code></em>。
  </p>
  <p class="para">
   <em><code class="parameter">internal_encoding</code></em> 和 <em><code class="parameter">output_encoding</code></em> 应当在 <var class="filename">php.ini</var> 文件或 <span class="function"><a href="function.iconv-set-encoding.html" class="function">iconv_set_encoding()</a></span> 中定义。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ob-iconv-handler-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   关于处理程序参数的信息，参见 <span class="function"><a href="function.ob-start.html" class="function">ob_start()</a></span>。
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ob-iconv-handler-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   关于处理程序返回值的信息，参见 <span class="function"><a href="function.ob-start.html" class="function">ob_start()</a></span>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ob-iconv-handler-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2416">
    <p><strong>Example #1 <span class="function"><strong>ob_iconv_handler()</strong></span> 例子：</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />iconv_set_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">"internal_encoding"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">iconv_set_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">"output_encoding"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ISO-8859-1"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ob_start</span><span style="color: #007700">(</span><span style="color: #DD0000">"ob_iconv_handler"</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;开始输出缓冲<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ob-iconv-handler-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.iconv-get-encoding.html" class="function" rel="rdfs-seeAlso">iconv_get_encoding()</a> - 获取 iconv 扩展的内部配置变量</span></li>
    <li class="member"><span class="function"><a href="function.iconv-set-encoding.html" class="function" rel="rdfs-seeAlso">iconv_set_encoding()</a> - 为字符编码转换设定当前设置</span></li>
    <li class="member"><a href="ref.outcontrol.html" class="link">输出控制函数</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.iconv.html">iconv</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.intl.html">intl</a></div>
 <div class="up"><a href="ref.iconv.html">iconv 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
